package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

@RestController
public class LoginController {

    @RequestMapping("login")
    public BaseRespVo login(String username, String password, HttpSession session) {
        if ("songge".equals(username) && "niupi".equals(password)) {
            session.setAttribute("user",username);
        }
        return BaseRespVo.ok();
    }

    @RequestMapping("hello")
    public BaseRespVo hello() {
        return BaseRespVo.ok("学姐好");
    }
}
